<template>
  <div>
    <breadcrumb :data="['首页','数据统计','数据报表']" />
    <el-card class="tableTop">
      <div id="main" style="width: 100%;height:400px;"></div>
    </el-card>
  </div>
</template>
<script>
import breadcrumb from "../son/breadcrumb.vue";
import echarts from "echarts";
import _ from 'lodash';
export default {
  components: {
    breadcrumb
  },
  created() {},
  /* 此时页面元素已经被渲染完毕了 */
  mounted() {
    var myChart = echarts.init(document.getElementById("main"));
    var option = {};
    _.merge(option,this.option)
    myChart.setOption(option);
  },

  data() {
    return {
        /* 需要合并的数据 */
      option: {
        title: {
          text: "数据统计报表"
        },
        tooltip: {
          trigger: "axis",
          axisPointer: {
            type: "cross",
            label: {
              backgroundColor: "#6a7985"
            }
          }
        },
        legend: {
          data: ["衣物服饰", "电子数码", "零食小吃", "宠物必备", "日用家居"]
        },
        toolbox: {
          feature: {
            saveAsImage: {}
          }
        },
        grid: {
          left: "3%",
          right: "4%",
          bottom: "3%",
          containLabel: true
        },
        xAxis: [
          {
            type: "category",
            boundaryGap: false,
            data: ["平均", "华东", "华西", "华南", "华北", "华中", "其他"]
          }
        ],
        yAxis: [
          {
            type: "value"
          }
        ],
        series: [
          {
            name: "衣物服饰",
            type: "line",
            stack: "总量",
            areaStyle: {},
            data: [120, 132, 101, 134, 90, 230, 210]
          },
          {
            name: "电子数码",
            type: "line",
            stack: "总量",
            areaStyle: {},
            data: [220, 182, 191, 234, 290, 330, 310]
          },
          {
            name: "零食小吃",
            type: "line",
            stack: "总量",
            areaStyle: {},
            data: [150, 232, 201, 154, 190, 330, 410]
          },
          {
            name: "宠物必备",
            type: "line",
            stack: "总量",
            areaStyle: {},
            data: [320, 332, 301, 334, 390, 330, 320]
          },
          {
            name: "日用家居",
            type: "line",
            stack: "总量",
            label: {
              normal: {
                show: true,
                position: "top"
              }
            },
            areaStyle: {},
            data: [820, 932, 901, 934, 1290, 1330, 1320]
          }
        ]
      }
    };
  },
  methods: {}
};
</script>
<style scoped>
</style>